home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-03 | 1.5 KB | 31 lines | [TEXT/ToyS] |
- on run
- global nodeList, newList, useSpeech, pollInterval
- display dialog "How long (in seconds) between checks?" default answer "60"
- set pollInterval to the text returned of the result
- display dialog "Use visual alerts, spoken alerts, or both?" buttons {"Visual", "Spoken", "Both"} default button "Both"
- set useSpeech to the button returned of the result
- if useSpeech is "Spoken" or useSpeech is "Both" then speak "Initializing."
- list nodes type "AFPServer"
- set nodeList to the result
- if useSpeech is "Spoken" or useSpeech is "Both" then speak "Ready."
- end run
-
- on idle
- global nodeList, newList, useSpeech, pollInterval
- set AppleScript's text item delimiters to {":"}
- set newList to (list nodes type "AFPServer")
- repeat with serverName in newList
- if nodeList does not contain serverName then
- if useSpeech is "Spoken" or useSpeech is "Both" then speak (text item 1 of serverName) & " just came up."
- if useSpeech is "Visual" or useSpeech is "Both" then request attention message (text item 1 of serverName) & " just came up." timeout 15
- end if
- end repeat
- repeat with serverName in nodeList
- if newList does not contain serverName then
- if useSpeech is "Spoken" or useSpeech is "Both" then speak (text item 1 of serverName) & " just went down."
- if useSpeech is "Visual" or useSpeech is "Both" then request attention message (text item 1 of serverName) & " just went down." timeout 15
- end if
- end repeat
- set nodeList to newList
- return pollInterval
- end idle